UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VAS/hIgDZf+eZGdeHqf6Fbyx95Yqe9gTydcWhuOaeVs=' 
WHERE 
  key_id = '2ffa2d625a94d5bf5f08ad109b1b58304614b6b3bf72da6c0082f1860c653814' 
  AND (
    token = 'VAS/hIgDZf+eZGdeHqf6Fbyx95Yqe9gTydcWhuOaeVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028