UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sB03Hugn3SxSAQVgNcRuK2taNaAZ3/Yp3g+5KzvGsA0='
WHERE
key_id = 'b91fe034a9b4c7e16e5701a354cc8fb07192cbb54ad96a1e9e08c519b78f6fcb'
AND (
token = 'sB03Hugn3SxSAQVgNcRuK2taNaAZ3/Yp3g+5KzvGsA0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)