UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cqtMizAxxB4SG2rJ+/v24IBCF97D/npK6jcWPy1juRI='
WHERE
key_id = 'f155f539100a9f09584ceb42f220c2c5826a11da96154dd4d0826894cc83db6d'
AND (
token = 'cqtMizAxxB4SG2rJ+/v24IBCF97D/npK6jcWPy1juRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)