UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yUTCaVQDeFdciEiQppn/nDZ3qKQBmY+bYxvzQFD6djc=' 
WHERE 
  key_id = 'df09336443f90dd9e5c5b6ffe8b41e4d643d524beca0a953ace4c03f437e79d3' 
  AND (
    token = 'yUTCaVQDeFdciEiQppn/nDZ3qKQBmY+bYxvzQFD6djc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048