UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EEeOyJtbTJcWIpUJLBvBcS3I6wf+W/XLQ26oU3w/Ago='
WHERE
key_id = '55aff343e4d0f91a4861e1a6e4fbfd56c293457d915450a0b1a5655533bb0303'
AND (
token = 'EEeOyJtbTJcWIpUJLBvBcS3I6wf+W/XLQ26oU3w/Ago='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)