UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '95VVn5yi8udnRFjBl3Vlo55+fGgq84PwB3eZmZiVrm8='
WHERE
key_id = '49bf78d1e668f94f080ac8b2f798355e904d544f332f1c26945172549e2fe2bc'
AND (
token = '95VVn5yi8udnRFjBl3Vlo55+fGgq84PwB3eZmZiVrm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)