UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iidk4BxJ4XJknHh5uHRI1O3Zb1B2V3uHQ5GtJkholR4='
WHERE
key_id = '251db54e1c315d1f55dba8cf19f3839efda5901b083aa0192e948dc844e933ce'
AND (
token = 'iidk4BxJ4XJknHh5uHRI1O3Zb1B2V3uHQ5GtJkholR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)