UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LGr2R6JhNBl1yDB757cYM2gBADrB9l87iq7sdT75k48=' 
WHERE 
  key_id = '08d83637bd6d30ab7a472b4cd85561c0cd9abb301813f18b85495468341c5feb' 
  AND (
    token = 'LGr2R6JhNBl1yDB757cYM2gBADrB9l87iq7sdT75k48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017