UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DFV91EHaVzvAdpD5qHfrMQilocxm1Tv1MuWqUespaq0=' 
WHERE 
  key_id = '669ba72f2c8f3a9bc5808048acc5fb21c2cabd007e027a300a3f559cca877101' 
  AND (
    token = 'DFV91EHaVzvAdpD5qHfrMQilocxm1Tv1MuWqUespaq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056