UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eDeKv1NOzA+0DEyX0tRcR6hIEt+6OfZMYTeOcITfLig='
WHERE
key_id = 'fb1d9ded062ecf9d419ffa5cad2d00de2947f167f8bbdc6178ee91e21d1bcde5'
AND (
token = 'eDeKv1NOzA+0DEyX0tRcR6hIEt+6OfZMYTeOcITfLig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)