UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'T68JT5FM4OANvcCDhuZfcsNK+8DEAv1vVzgsnGtM85Y='
WHERE
key_id = '2ed709e4978310d1a1fd7771c6267afebc2a8eb334ac06f730cf7801c7db3fe4'
AND (
token = 'T68JT5FM4OANvcCDhuZfcsNK+8DEAv1vVzgsnGtM85Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)