UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wQcVHLAYToK2Q0rdcoLihH7EY9A0LePt3AajnfzcLCM='
WHERE
key_id = 'bc6e1c4b9cd1aac646589876d2d1e033fedd8a10f31cf623e91331592489e90c'
AND (
token = 'wQcVHLAYToK2Q0rdcoLihH7EY9A0LePt3AajnfzcLCM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)