UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/lv+1rgastze/4sgNgpDbW7+jRUUT4gSGMyUeL25fI=' 
WHERE 
  key_id = 'f697e2363b2b92f8ca436c5597a9d1ba12d41a6bb10ce543e77d1a0f762498b6' 
  AND (
    token = '7/lv+1rgastze/4sgNgpDbW7+jRUUT4gSGMyUeL25fI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038