UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/VZlgZs7o6xfKiRFMZIEbF38LEpGoG0CM2M9Z4mvNFc='
WHERE
key_id = '7a221245214fe84fbaa20c31dc30d1fe7c6df4c1c337b3b536aef4b70efe0267'
AND (
token = '/VZlgZs7o6xfKiRFMZIEbF38LEpGoG0CM2M9Z4mvNFc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)