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