UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cfKYNGWd5op4gmBR3AMg5FDs5lB0SgFBM9ATI1AZNo='
WHERE
key_id = '6f3e1888a82ff9c6177a750dbf8a1bbce62783cf1dc4ccc4725a8df9fb60ae75'
AND (
token = '6cfKYNGWd5op4gmBR3AMg5FDs5lB0SgFBM9ATI1AZNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)