UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vel5rddotuQsVHUTZGikpJ7m3pdxsmCimtu34BiIDcw=' 
WHERE 
  key_id = '9a6b3c26f0cb6946f9700e490308879bfff75fb2d7bb5a14011de07a07a43cca' 
  AND (
    token = 'vel5rddotuQsVHUTZGikpJ7m3pdxsmCimtu34BiIDcw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042