UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iTmLN1p4jhMwTVmKzPyBqEJkae7MEzeVSSAUXMKxDTY='
WHERE
key_id = '4c3360afa193671be239424abb0089b61b7de0b5cf6754448e5a34027aafcfda'
AND (
token = 'iTmLN1p4jhMwTVmKzPyBqEJkae7MEzeVSSAUXMKxDTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)