UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yn4R51JAJH4DIF6OSPNo/90bm9ooe9belvLNN31asZ4='
WHERE
key_id = '1d53fc22d8eb998e4399c1bbb6c07731f9d1b58dd5c8156e8626c78b753cb9f6'
AND (
token = 'yn4R51JAJH4DIF6OSPNo/90bm9ooe9belvLNN31asZ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)