UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0qnI1yP9/JvU60jWUp34OV/U7HKm+P/N1gWDyVEs71Q=' 
WHERE 
  key_id = '3f99d14c9325bdcf9da3a21e654bb7ef38bd0d035b8db899bef6c14c77b79963' 
  AND (
    token = '0qnI1yP9/JvU60jWUp34OV/U7HKm+P/N1gWDyVEs71Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046