UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rqcUVd6VQXVRA5p1O8n7E4d8uaO5Ja05BM1Pu3DVJSs='
WHERE
key_id = '71059497a5b5bd0a6aa0e6b8ef1206806b1ce881a19b9bdea97d8757da1f57de'
AND (
token = 'rqcUVd6VQXVRA5p1O8n7E4d8uaO5Ja05BM1Pu3DVJSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)