UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yJbZyNdjYPGyKtsM7aY5ia/cnyW881J0ACXO6aYFxIw='
WHERE
key_id = '3cf25022a1b43c949c62a7978ff20f97b4370df1269c351ebda3cf58d8199167'
AND (
token = 'yJbZyNdjYPGyKtsM7aY5ia/cnyW881J0ACXO6aYFxIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)