UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Vnr9tFeTFBaS7aubOrvPDA0eQckpop53g/bLJ5qTdmU='
WHERE
key_id = 'b30dccc744e8cf42b3fc05f2eec0445b0c2a3c06b9d06c8e63f46b3f50c8ea24'
AND (
token = 'Vnr9tFeTFBaS7aubOrvPDA0eQckpop53g/bLJ5qTdmU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)