UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sWlJ9FKj7ePQQ7R/fsjvyuypOjzERkgGVvCvIEXl3TE='
WHERE
key_id = '0af712a9053bc9afa4e67bc16e337be9ced35b7df5bb30817ed2a59ee742ac93'
AND (
token = 'sWlJ9FKj7ePQQ7R/fsjvyuypOjzERkgGVvCvIEXl3TE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)