UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6HuW8ColZTdsGxyiPe3Zpl9Jo9XFspjO2aplrgESrbI='
WHERE
key_id = 'afe1e27a3e9d65646a8a6bf996bfc42dfda7d1303fa2a28ffc471dfcf8ecb6bb'
AND (
token = '6HuW8ColZTdsGxyiPe3Zpl9Jo9XFspjO2aplrgESrbI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)