UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C+CvqOqQQ3I/JYx4lQkNm8aKjS8Yrp8VTaOpSFYD67A='
WHERE
key_id = 'f36264ebaf15545aa9d0821bcc9abfaa55d0b48a8dfef4fdbe3bd5b02ba26abf'
AND (
token = 'C+CvqOqQQ3I/JYx4lQkNm8aKjS8Yrp8VTaOpSFYD67A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)