UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7bj4ptF+xKBau+E/R+PWeowxCZXSvwpBRu2wghGrFLs='
WHERE
key_id = 'a3fb7f5576ab14d544abe3f9b36fef0d42ecc36de89919b1ad185ed52f659d0b'
AND (
token = '7bj4ptF+xKBau+E/R+PWeowxCZXSvwpBRu2wghGrFLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)