UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3h3Pg1IEBZWAEdHl5MB9lF0KZsM9IiIWlmX40CSHPJw='
WHERE
key_id = '77546111e45a8e242df8562266d4844f10409da73901c5b0ea5848b92b06a635'
AND (
token = '3h3Pg1IEBZWAEdHl5MB9lF0KZsM9IiIWlmX40CSHPJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)