UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DDg3xZRafUezgy8NUn3cZ/kSiM1GDE3buKGYntva61E='
WHERE
key_id = '9c13914cca1082559832de852a1d1eb118a41a6bf1c28955f7ff447fd54add98'
AND (
token = 'DDg3xZRafUezgy8NUn3cZ/kSiM1GDE3buKGYntva61E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)